package com.xmy.cultivate.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.xmy.cultivate.entity.Grade;
import com.xmy.cultivate.entity.StudentGrade;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xmy.cultivate.entity.response.ArrivalRate;
import com.xmy.cultivate.entity.views.ShiftList;
import com.xmy.cultivate.respons.NotScheduled;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 学生所在班级与课程 服务类
 * </p>
 *
 * @author min
 * @since 2022-08-09
 */
public interface IStudentGradeService extends IService<StudentGrade> {

    public abstract IPage<ShiftList> findAll(IPage<?> page, Wrapper wrapper);

    public abstract boolean divideClasses(Long orderDetailId, Long gradeId);

    public abstract boolean melodyClass(StudentGrade studentGrade);

    public abstract boolean addData(Long orderDetailId, Long schoolId, Long studentId, Long gradeId, Long courseId, Long subjectsId, Integer yearPart, Integer quarterNum, Integer surplusCourseNum);

    StudentGrade getLastStudentGradeForOrderDetailId(Long schoolId, Long studentId, Long subjectsId, Integer yearPart, Integer quaterNum, boolean isInludeSchool, Integer lessonType);

    /**
     * 在读学员数量
     *
     * @param reMap
     * @return
     */
    public abstract Integer inReadStudentCount(Map reMap);

    /**
     * 异常学员数量
     *
     * @param reMap
     * @return
     */
    public abstract Integer abnormalStudentCount(Map reMap);

    /**
     * 结课学员数量
     *
     * @param reMap
     * @return
     */
    public abstract Integer overStudentCount(Map reMap);

    /**
     * 退费学员数量
     *
     * @param reMap
     * @return
     */
    public abstract Integer returnStudentCount(Map reMap);

    /**
     * 转校学员数量
     *
     * @param reMap
     * @return
     */
    public abstract Integer changeStudentCount(Map reMap);

    /**
     * 停课学员数量
     *
     * @param reMap
     * @return
     */
    public abstract Integer stopStudentCount(Map reMap);

    //================================================================


    /**
     * 在读学员数量
     *
     * @param reMap
     * @return
     */
    public abstract List<StudentGrade> inReadStudentList(Map reMap);

    /**
     * 异常学员数量
     *
     * @param reMap
     * @return
     */
    public abstract List<StudentGrade> abnormalStudentList(Map reMap);

    /**
     * 结课学员数量
     *
     * @param reMap
     * @return
     */
    public abstract List<StudentGrade> overStudentList(Map reMap);

    /**
     * 退费学员数量
     *
     * @param reMap
     * @return
     */
    public abstract List<StudentGrade> returnStudentList(Map reMap);

    /**
     * 转校学员数量
     *
     * @param reMap
     * @return
     */
    public abstract List<StudentGrade> changeStudentList(Map reMap);

    /**
     * 停课学员数量
     *
     * @param reMap
     * @return
     */
    public abstract List<StudentGrade> stopStudentList(Map reMap);

    /**
     * 精品课未排班详情
     *
     * @param page
     * @param yearPart
     * @param quarterNum
     * @param subjectsId
     * @param schoolId
     * @return
     */
    public abstract IPage<StudentGrade> notAlreadyStudent(IPage<?> page, String yearPart, String quarterNum, String subjectsId, String schoolId, String yearClassId, Integer isHistory, String startResidue, String endResidue, String yearAndQuarter);

    /**
     * 复刷排班未排班学员详情
     *
     * @param page
     * @param yearPart
     * @param quarterNum
     * @param subjectsId
     * @param teacherId
     * @return
     */
    public abstract IPage<StudentGrade> notAlreadyBrushStudentDetail(IPage<?> page, String yearPart, String quarterNum, String subjectsId, String teacherId, String schoolId, String lessonType, String yearClassId);

    /**
     * 精品课已排班，智能课和刷题班未排班学员详情
     *
     * @param page
     * @param yearPart
     * @param quarterNum
     * @param subjectsId
     * @param teacherId
     * @return
     */
    public abstract IPage<StudentGrade> notAlreadyPracticeStudent(IPage<?> page, String yearPart, String quarterNum, String subjectsId, String teacherId, String schoolId, String lessonType, String yearClassId);


    /**
     * 精品课已排班，智能课和刷题班未排班学员数量
     *
     * @param page
     * @param yearPart
     * @param quarterNum
     * @param subjectsId
     * @return
     */
    public abstract IPage<StudentGrade> notAlreadyPracticeCount(IPage<?> page, String yearPart, String quarterNum, String subjectsId, String schoolId, String lessonType, String type, String yearClassId);

    /**
     * 刷题班未排班学员复刷班型数量
     *
     * @param yearPart
     * @param quarterNum
     * @param subjectsId
     * @return
     */
    public abstract List<StudentGrade> reBrushStudentCount(String yearPart, String quarterNum, String subjectsId, String schoolId, String lessonType, String type, String yearClassId);

    //调用存储过程
    void callStoreAgainBrushData(String yearPart, String quarterNum, String subjectsId, String yearClassId);

    /**
     * 精品课已排班数量
     */
    public abstract Integer alreadyCount(String yearPart, String quarterNum, String subjectsId, Integer isHistory, Long schoolId, String yearClassId, String startResidue, String endResidue);

    /**
     * 精品课未排班数量
     */
    public abstract Integer notAlreadyCount(String yearPart, String quarterNum, String subjectsId, Long schoolId, String yearClassId, Integer isHistory, String startResidue, String endResidue);

    public abstract List<StudentGrade> orderDetailList(String yearPart, String quarterNum, String subjectsId, String yearClassId);

    /**
     * 数学-数据录入列表
     */
    public List<StudentGrade> getTaskList(String lessonNum);

    Long getStudentUseCourseCountAllSchool(Integer yearPart,
                                           Integer quarterNum,
                                           Long subjectsId,
                                           Long studentId,
                                           Integer lessonType);
//    public IPage<StudentGrade> getTaskList(IPage<?> page, String lessonNum, String field, String yearClassId, String quarterNum, String courseTypeId, Wrapper wrapper);

    public abstract List<Grade> getGradeFloatList(String yearPart, String quarterNum, String yearClassId, String classTypeId, String subjectsId, String schoolId, String type, String date);

    public abstract IPage<Grade> getGradeFloatDetails(IPage<?> page, String yearPart, String quarterNum, String yearClassId, String classTypeId, String subjectsId, String schoolId, String gradeId, String teacherId, String date);

    IPage<StudentGrade> alreadyStudent(IPage<?> page, String yearPart, String quarterNum, String subjectsId, String schoolId, String yearClassId, String isHistory, String startResidue, String endResidue);

    IPage<StudentGrade> alreadyAllStudent(IPage<?> page, String yearPart, String quarterNum, String subjectsId, String schoolId, String yearClassId, String isHistory, String startResidue, String endResidue);

    public abstract List<Grade> getGradeFloatTeamList(String yearPart, String quarterNum, String yearClassId, String classTypeId, String subjectsId, String schoolId, String isDetails, String date, String teamId);

    public abstract IPage<Grade> getGradeFloatTeamDetailsList(IPage<?> page, String yearPart, String quarterNum, String yearClassId, String classTypeId, String subjectsId, String schoolId, String date, String teamId, String teacherId, String gradeId);

    public abstract List<NotScheduled> alreadyCountNew(String yearPart, String quarterNum, String subjectsId, Integer isHistory, String yearClassId, String startResidue, String endResidue);

    StudentGrade getLastOne(Integer yearPart, Integer quarterNum, Long subjectsId, Long studentId, Integer lessonType);

    public abstract Long getStudentUseCourseCount(Integer yearPart, Integer quarterNum, Long schoolId, Long subjectsId, Long studentId, Integer lessonType);

    StudentGrade getLastForMaxId(Integer yearPart, Integer quarterNum, Long subjectsId, Long studentId, Integer lessonType);

    public abstract List<StudentGrade> adjustGradeList(Integer yearPart,Integer quarterNum,Integer type,String schoolId,String yearClassId,String classTypeId,String subjectsId,String name,String teamId,String classify,String trackType,Integer isDetails);

    public abstract IPage<StudentGrade> adjustGradeDetails(IPage<?> page, Integer yearPart, Integer quarterNum, String schoolId, String yearClassId, Integer type, String classTypeId, String gradeId, String teamId, String classify, String trackType, Integer detailType, String subjectsId, String teacherId);


}
